/*created by hp
*on 18-10-14 下午4:11
*/
package com.happts.UI;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Menu {
    JButton saveIn, fetchOut;
    ImageIcon in = new ImageIcon("src/com/happts/img/存油.png");
    ImageIcon out = new ImageIcon("src/com/happts/img/取油.png");
    Menu(){
        JFrame frame = UtilView.createFrame("菜单");
        frame.setSize(500, 300);
        frame.setLocation(700, 400);
        frame.setLayout(null);

        saveIn = new JButton(in);
        saveIn.setBounds(70, 90, 140, 80);
        fetchOut = new JButton(out);
        fetchOut.setBounds(280, 90, 140, 80);

        saveIn.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                frame.dispose();
                new SaveIn();
            }
        });
        fetchOut.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                frame.dispose();
                new RecordUI();
            }
        });
        frame.add(saveIn);
        frame.add(fetchOut);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
        frame.setResizable(false);
        frame.setTitle("菜单");
    }
    public static void main(String[] args){
        new Menu();
    }
}
